<?php
include_once( "common.php" );

if ( isLoggedIn() )
{
    if ( is_numeric( $_GET["id"] ) )
        header( "Location: viewBug.php?id={$_GET["id"]}" );
    else
        header( "Location: main.php" );
}

outputHeader();
?>
<div class = "header">Login</div>
<form action = "login.php" method = "post">
<?php
if ( is_numeric( $_GET["id"] ) )
    print "<input type = 'hidden' name = 'id' value = '{$_GET["id"]}' />\n";
?>
<table class = "login">
<tr><td>User</td><td><input type = "text" name = "user" /></td></tr>
<tr><td>Password</td><td><input type = "password" name = "password" /></td></tr>
<tr><td></td><td><input type = "submit" value = "Authenticate" /></td></tr>
</table>
</form>
<?php
outputFooter();
?>
